<?php

declare(strict_types=1);

namespace App\Service;

use Hyperf\Di\Annotation\Inject;
use Hyperf\AsyncQueue\Annotation\AsyncQueueMessage;
use Hyperf\Amqp\Producer;
use App\Amqp\Producer\DemoProducer;

class TestJobService
{
    #[Inject]
    protected Producer $producer;

    #[AsyncQueueMessage(pool: "test", delay: 3, maxAttempts: 5)]
    public function test($params)
    {
        $message = new DemoProducer($params);

        $result = $this->producer->produce($message);

        return $result;
    }
}